import request from '@/utils/request'
const hosp_api_name = '/admin/hosp/hospital'
const cmn_api_name = '/admin/cmn/dict'
const dep_api_name = '/admin/hosp/department'
const sche_api_name = '/admin/hosp/schedule'


export default{
//分页查询接口
selectByPageAndCondition(page,limit,searchObj){
return request({
    url: `${hosp_api_name}/selectByPage/${page}/${limit}`,
    method: 'get',
    params:searchObj
})
},

//根据dictcode查询所有子节点(所有省)
getByDictCode(dictCode){
    return request({
        url: `${cmn_api_name}/getByDictCode/${dictCode}`,
        method: 'get'
    })
},

//根据数据id查询子数据列表
findChildData(id){
    return request({
        url: `${cmn_api_name}/findChildData/${id}`,
        method: 'get'
    })
},

//更改医院状态的值
updateStatus(id,status){
    return request({
        url: `${hosp_api_name}/updateStatus/${id}/${status}`,
        method: 'put'
    })
},

//查看医院详情信息
showDetails(id){
    return request({
        url: `${hosp_api_name}/showDetails/${id}`,
        method: 'get'
    })
},

//查询医院科室列表
getDeptList(hoscode){
    return request({
        url: `${dep_api_name}/getDeptList/${hoscode}`,
        method: 'get'
    })
},

//查询对应科室排班规则
getScheduleRule(page, limit, hoscode, depcode){
    return request({
        url: `${sche_api_name}/getScheduleList/${page}/${limit}/${hoscode}/${depcode}`,
        method: 'get'
    })
},

//查询对应日期的排班情况
getScheduleDetails(hoscode, depcode, workDate){
    return request({
        url: `${sche_api_name}/getScheduleDetails/${hoscode}/${depcode}/${workDate}`,
        method: 'get'
    })
}
}